function getRandomAvatar() {
    return `static/avatar/${parseInt(Math.random()*10+1)}.jpg`;
}

function getNowDate() {
    var date = new Date();
    var time = `${date.getFullYear()}-${date.getMonth()+1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
    return time;
}

function genId(num = 9) {
    let id = "";
    for (let i = 0; i < num; i++) {
        id += parseInt(Math.random() * 10);
    }
    return id;
}

module.exports = {
    getNowDate,
    getRandomAvatar,
    genId
}